package com.sinosoft.hydra.um.services.component.dataimport;

import com.sinosoft.hydra.um.LoginUser;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2016/6/29.
 */
public class ImportParam {

    private LoginUser loginUser;
    private List<Source> sources;
    private List<String> failures = new ArrayList<String>();
    private Map<String, String[]> param = new HashMap<String, String[]>();

    public ImportParam(LoginUser loginUser, Map<String, String[]> param) {
        this.loginUser = loginUser;
        this.param = param;
    }

    public LoginUser getLoginUser() {
        return loginUser;
    }

    public Map<String, String[]> getParam() {
        return param;
    }

    public void setSources(List<Source> sources) {
        this.sources = sources;
    }

    public List<Source> getSources() {
        return sources;
    }

    public static class Source {
        int rowNum;
        private Object object;

        public Source(int rowNum, Object object) {
            this.rowNum = rowNum;
            this.object = object;
        }

        public int getRowNum() {
            return rowNum;
        }

        public void setRowNum(int rowNum) {
            this.rowNum = rowNum;
        }

        public Object getObject() {
            return object;
        }

        public void setObject(Object object) {
            this.object = object;
        }
    }


    public void addFailure(String msg){
        failures.add(msg);
    }

    public List<String> getFailures() {
        return failures;
    }
}
